/**
 * Created by dujiaheng on 2016/8/30.
 */

function windowSize(slFix = 0) {
    var width = window.innerWidth;
    var height = window.innerHeight;
    if (typeof width != 'number') {
        if (document.compatMode == 'CSS1Compat') {
            width = document.documentElement.clientWidth;
            height = document.docuementElement.clientHeight;
        } else {
            width = document.body.clientWidth;
            height = document.body.clientHeight;
        }
    }
    return {
        width: width,
        height: height,
        slRate: width > height ? (width + slFix) / height : (height + slFix) / width
    }
}

export {windowSize}